<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let fields = {
            hosname: undefined,
            hoscode: undefined,
            hostype: undefined,
            provinceCode: false,
            cityCode: undefined,
            districtCode: 0,
            status: undefined
        }
        // 将对象的属性名变成一个数组
        console.log(Object.keys(fields));

        // 将对象的属性值变成一个数组
        console.log(Object.values(fields));

        console.log(Object.values(fields).every(item=>item===undefined))
    </script>
</body>

</html>